﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;

namespace MicropleSoft.WmsApp.Base.Exceptions
{
    public class ExceptionHandler
    {
        public static void ShowException(Exception e)
        {
            string msg = e.Message;
            if (e.InnerException != null)
            {
                msg += ("\n具体错误：" + e.InnerException.Message);
            }
            XtraMessageBox.Show(msg, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void ShowException(string msg)
        {
            string message = "具体错误：\n" + msg;

            XtraMessageBox.Show(message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
        }
    }
}
